<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<!-- 开发环境版本，包含了有帮助的命令行警告 -->
		<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
	</head>
	<body>
		<div id="demo">
			<ol>
				<!-- v-for 指令可以绑定数组的数据来渲染一个项目列表 -->
				<li v-for="todo in todos">
					{{todo.text}}
				</li>
			</ol>
		</div>
		<script type="text/javascript">
			var vue = new Vue({
				el: "#demo",
				data: {
					todos: [{
							text: "item 1"
						},
						{
							text: "item 2"
						},
						{
							text: "item 3"
						}
					]
				},
			})
			//控制台测试增加新项
			vue.todos.push({
				text: "item 4"
			});
		</script>

	</body>
</html>
